import { createRouter, createWebHistory } from "vue-router"

// 引入要配置路由的组件
import Login from "@/components/Login.vue"
import Home from "@/components/Home.vue"
// 
import UpdateLog from "@/page/UpdateLog/UpdateLog.vue"
import AllFoodMessage from "@/page/FoodMessage/AllFoodMessage/AllFoodMessage.vue"
import NowFoodMessage from "@/page/FoodMessage/NowFoodMessage/NowFoodMessage.vue"
import RootSetting from "@/page/RootSetting/RootSetting.vue"
import ChatSetting from "@/page/ChatSetting/ChatSetting.vue"
import Default from "@/page/Default/Default.vue"
import UserSetting from "@/page/UserSetting/UserSetting.vue"
import FirstCont from "@/page/ResourceControl/FirstCont.vue"
import FirstDict from "@/page/ResourceControl/FirstDict.vue"
import SecondCont from "@/page/ResourceControl/SecondCont.vue"
import SecondDict from "@/page/ResourceControl/SecondDict.vue"

const router = createRouter({
    history: createWebHistory("/ShiLianZhiKong_Root/"),
    routes: [
        {
            path: "/",
            redirect: "/login"
        },
        {
            path: "/login",
            name: "登录",
            component: Login
        },
        {
            path: "/home",
            name: "主页",
            component: Home,
            children: [
                {
                    path: "allfoodmessage",
                    name: "获取所有食物信息",
                    component: AllFoodMessage
                }, {
                    path: "nowfoodmessage",
                    name: "获取单个食物信息",
                    component: NowFoodMessage
                }, {
                    path: "updatelog",
                    name: "更新日志管理",
                    component: UpdateLog
                }, {
                    path: "rootsetting",
                    name: "管理员设置",
                    component: RootSetting
                }, {
                    path: "chatsetting",
                    name: "查询全部会话",
                    component: ChatSetting
                }, {
                    path: "default",
                    name: "默认页面",
                    component: Default
                }, {
                    path: "usersetting",
                    name: "用户管理",
                    component: UserSetting
                },{
                    path:"resourcefirstD",
                    name:"一级目录管理",
                    component:FirstDict
                },{
                    path:"resourcefirstC",
                    name:"一级目录内容管理",
                    component:FirstCont
                },{
                    path:"resourcesecondD",
                    name:"二级目录管理",
                    component:SecondDict
                },{
                    path:"resourcesecondC",
                    name:"二级目录内容管理",
                    component:SecondCont
                }
            ]
        }
    ]
})
export default router // 暴露组件
